<?php
namespace App\Http\Controllers\Api;

use App\Api\Helpers\ApiResponse;
use App\Http\Controllers\Controller;
use App\Models\ReceivePaymentBody;
use App\Models\WtRequest;

class ReceivePaymentBodyController extends Controller
{
    use ApiResponse;

    public function store()
    {
        $all = request()->all();

//        WtRequest::query()->create([
//            'post' => $_POST,
//            'server' => $_SERVER,
//            'data' => $all
//        ]);

        try {
            if (ReceivePaymentBody::query()->where('Rowid', $all['Rowid'])->doesntExist()) {
                ReceivePaymentBody::query()->create($all);
            }
        } catch (\Exception $e) {
            return $this->failed("数据插入失败");
        }

        return $this->message('数据插入成功');
    }

}